// 封装轮播图相关的业务代码

import { onMounted, ref } from "vue";
import { HomeApi } from "../../../apis/home.ts";

export const useBanner = () => {
  const bannerList = ref([]);
  const getBannerList = async () => {
    const res = await HomeApi.getBanner({ distributionSite: "2" });
    bannerList.value = res.data.result;
  };

  onMounted(() => {
    getBannerList();
  });

  return {
    bannerList,
  };
};
